package com.dd.common.exception;

import com.dd.common.entity.ResultCode;
import lombok.Getter;

@Getter
public class BussinessException extends RuntimeException {
    private ResultCode codeEnum;

    public BussinessException(ResultCode codeEnum){
        this.codeEnum = codeEnum;
    }

    public int getErrorCode(){
        return codeEnum.getCode();
    }

    public String getErrorMsg(){
        return codeEnum.getMessage();
    }
}
